package com.yuandian.management.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yuandian.api.management.entity.ConfExclusiveIndicator;
import com.yuandian.bpm.common.core.util.R;
import com.yuandian.management.vo.ExclusiveIndicatorVo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * 专属指标表-Service接口
 * @author zfsn
 * @date 2023-3-22
 */
public interface ConfExclusiveIndicatorService extends IService<ConfExclusiveIndicator> {

	/**
	 * 下载专属指标导入模板
	 * @param response 响应上下文
	 */
	void importTemplate(HttpServletResponse response) throws IOException;



	/**
	 * 导出(下载)专属指标列表
	 * @param exclusiveIndicator 专属指标查询参数
	 */
	void downloadExclusiveIndicators(ConfExclusiveIndicator exclusiveIndicator, HttpServletResponse response) throws IOException;

	/**
	 * 分页查询
	 * @param confExclusiveIndicator 筛选条件
	 * @return 通用返回对象
	 */
	Page<ExclusiveIndicatorVo> listPage(ConfExclusiveIndicator confExclusiveIndicator);

    List<ConfExclusiveIndicator> selectByResourceCodes(List<String> list);

	/**
	 * 组装需要展示的字段(需求886-20220510)
	 * @return
	 */
	Map<String, Object> assemblyDisplayField(Map<String, Object> map);

	Map<String, Object> queryCustomDisplayFields(String type);

	Map<String, Object> assemblyDisplayFieldInner(Map<String, Object> map);

	/**
	 * 通过主键查询数据
	 * @param resourceCode 业务资源
	 * @return 通用返回对象
	 */
	ConfExclusiveIndicator getExclusiveIndicatorByResourceCode(String resourceCode);

	R<String> updateByResourceCode(ConfExclusiveIndicator confExclusiveIndicator);


	/**
	 * 根据业务资源获取系统,业务名称，步骤名称信息
	 * @param
	 * @param resourceCode
	 * @return
	 */
	Page<Map<String, String>> getSystemAndBusinessAndStepNameByResourceCode(ConfExclusiveIndicator resourceCode);

	/**
	 * 根据业务资源查询网端信息
	 * @param
	 * @param resourceCode
	 * @return
	 */
	Page<Map<String, String>> getSegmentInfoByResourceCode(ConfExclusiveIndicator resourceCode);

	/**
	 * 批量多资源导入专属指标
	 * @param file excel文件
	 * @return 通用返回对象
	 */
    R importExcel(MultipartFile file, List<String> resourceCodes) throws IOException;


    void deleteSyncExclusiveIndicators(Map<String, Object> map);
}
